.class public Les/aa;
.super Ljava/lang/Object;
.source "BackgroundAudioMixer.java"


# instance fields
.field private a:Les/w9$d;

.field private b:Les/w9;

.field private c:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Les/ba;",
            ">;"
        }
    .end annotation
.end field

.field private d:Z

.field private e:Z

.field private final f:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Lcom/esfile/screen/recorder/media/util/l;",
            ">;"
        }
    .end annotation
.end field

.field private g:Z

.field private h:Les/t9$a;

.field private i:Ljava/nio/ByteBuffer;

.field private final j:[Ljava/nio/ByteBuffer;

.field private k:Z

.field private l:Les/ba;


# direct methods
.method public constructor <init>(Ljava/util/List;II)V
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Les/ba;",
            ">;II)V"
        }
    .end annotation

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-boolean v0, p0, Les/aa;->d:Z

    .line 3
    iput-boolean v0, p0, Les/aa;->e:Z

    .line 4
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    iput-object v1, p0, Les/aa;->f:Ljava/util/List;

    .line 5
    iput-boolean v0, p0, Les/aa;->g:Z

    .line 6
    new-instance v1, Les/aa$b;

    invoke-direct {v1, p0}, Les/aa$b;-><init>(Les/aa;)V

    iput-object v1, p0, Les/aa;->h:Les/t9$a;

    const/4 v1, 0x2

    new-array v1, v1, [Ljava/nio/ByteBuffer;

    .line 7
    iput-object v1, p0, Les/aa;->j:[Ljava/nio/ByteBuffer;

    .line 8
    iput-boolean v0, p0, Les/aa;->k:Z

    .line 9
    iput-object p1, p0, Les/aa;->c:Ljava/util/List;

    .line 10
    new-instance v0, Les/aa$a;

    invoke-direct {v0, p0}, Les/aa$a;-><init>(Les/aa;)V

    invoke-static {p1, v0}, Ljava/util/Collections;->sort(Ljava/util/List;Ljava/util/Comparator;)V

    .line 11
    new-instance p1, Les/w9$d;

    invoke-direct {p1}, Les/w9$d;-><init>()V

    iput-object p1, p0, Les/aa;->a:Les/w9$d;

    .line 12
    iput p2, p1, Les/w9$d;->c:I

    .line 13
    iput p3, p1, Les/w9$d;->d:I

    return-void
.end method

.method static synthetic a(Les/aa;)Z
    .locals 0

    .line 1
    iget-boolean p0, p0, Les/aa;->d:Z

    return p0
.end method

.method static synthetic a(Les/aa;Z)Z
    .locals 0

    .line 2
    iput-boolean p1, p0, Les/aa;->g:Z

    return p1
.end method

.method private declared-synchronized a(Les/ba;)Z
    .locals 7

    monitor-enter p0

    .line 4
    :try_start_0
    iget-boolean v0, p0, Les/aa;->d:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    const/4 v1, 0x0

    if-nez v0, :cond_0

    .line 5
    monitor-exit p0

    return v1

    .line 6
    :cond_0
    :try_start_1
    iget-object v0, p1, Les/ba;->c:Landroid/util/Pair;

    .line 7
    iget-object v2, p0, Les/aa;->a:Les/w9$d;

    const-wide/16 v3, -0x1

    if-eqz v0, :cond_1

    iget-object v5, v0, Landroid/util/Pair;->first:Ljava/lang/Object;

    check-cast v5, Ljava/lang/Long;

    invoke-virtual {v5}, Ljava/lang/Long;->longValue()J

    move-result-wide v5

    goto :goto_0

    :cond_1
    move-wide v5, v3

    :goto_0
    iput-wide v5, v2, Les/w9$d;->a:J

    .line 8
    iget-object v2, p0, Les/aa;->a:Les/w9$d;

    if-eqz v0, :cond_2

    iget-object v0, v0, Landroid/util/Pair;->second:Ljava/lang/Object;

    check-cast v0, Ljava/lang/Long;

    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v3

    :cond_2
    iput-wide v3, v2, Les/w9$d;->b:J

    .line 9
    iget-object v0, p0, Les/aa;->a:Les/w9$d;

    iget v2, p1, Les/ba;->e:F

    iput v2, v0, Les/w9$d;->e:F

    .line 10
    iget-object v0, p0, Les/aa;->a:Les/w9$d;

    iget-boolean v2, p1, Les/ba;->f:Z

    iput-boolean v2, v0, Les/w9$d;->f:Z

    .line 11
    invoke-direct {p0}, Les/aa;->e()V

    .line 12
    new-instance v0, Les/w9;

    iget-object p1, p1, Les/ba;->b:Ljava/lang/String;

    iget-object v2, p0, Les/aa;->a:Les/w9$d;

    invoke-direct {v0, p1, v2, v1}, Les/w9;-><init>(Ljava/lang/String;Les/w9$d;Z)V

    iput-object v0, p0, Les/aa;->b:Les/w9;

    .line 13
    iget-object p1, p0, Les/aa;->h:Les/t9$a;

    invoke-virtual {v0, p1}, Les/t9;->a(Les/t9$a;)V

    .line 14
    iput-boolean v1, p0, Les/aa;->k:Z

    .line 15
    iput-boolean v1, p0, Les/aa;->g:Z

    .line 16
    invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V

    .line 17
    iget-object p1, p0, Les/aa;->b:Les/w9;

    invoke-virtual {p1}, Les/w9;->f()Z

    move-result p1

    if-nez p1, :cond_3

    .line 18
    iget-object p1, p0, Les/aa;->b:Les/w9;

    invoke-virtual {p1}, Les/t9;->d()V

    const/4 p1, 0x0

    .line 19
    iput-object p1, p0, Les/aa;->b:Les/w9;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 20
    monitor-exit p0

    return v1

    :cond_3
    const/4 p1, 0x1

    .line 21
    monitor-exit p0

    return p1

    :catchall_0
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method static synthetic b(Les/aa;)Les/w9;
    .locals 0

    .line 1
    iget-object p0, p0, Les/aa;->b:Les/w9;

    return-object p0
.end method

.method static synthetic c(Les/aa;)Ljava/util/List;
    .locals 0

    .line 1
    iget-object p0, p0, Les/aa;->f:Ljava/util/List;

    return-object p0
.end method

.method private declared-synchronized e()V
    .locals 2

    monitor-enter p0

    .line 1
    :try_start_0
    iget-object v0, p0, Les/aa;->b:Les/w9;

    if-eqz v0, :cond_0

    .line 2
    iget-object v0, p0, Les/aa;->b:Les/w9;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Les/t9;->a(Les/t9$a;)V

    .line 3
    iget-object v0, p0, Les/aa;->b:Les/w9;

    invoke-virtual {v0}, Les/t9;->d()V

    .line 4
    iput-object v1, p0, Les/aa;->b:Les/w9;

    .line 5
    :cond_0
    iget-object v0, p0, Les/aa;->f:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_1

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/esfile/screen/recorder/media/util/l;

    .line 6
    invoke-virtual {v1}, Lcom/esfile/screen/recorder/media/util/l;->a()V

    goto :goto_0

    .line 7
    :cond_1
    iget-object v0, p0, Les/aa;->f:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->clear()V

    .line 8
    invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 9
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    goto :goto_2

    :goto_1
    throw v0

    :goto_2
    goto :goto_1
.end method


# virtual methods
.method public a()I
    .locals 1

    .line 3
    iget-object v0, p0, Les/aa;->a:Les/w9$d;

    iget v0, v0, Les/w9$d;->d:I

    return v0
.end method

.method public a(Lcom/esfile/screen/recorder/media/util/l;Lcom/esfile/screen/recorder/media/util/l;)I
    .locals 6

    .line 22
    iget-object v0, p0, Les/aa;->l:Les/ba;

    if-eqz v0, :cond_0

    iget-wide v1, p1, Lcom/esfile/screen/recorder/media/util/l;->c:J

    iget-object v0, v0, Les/ba;->d:Landroid/util/Pair;

    invoke-static {v1, v2, v0}, Lcom/esfile/screen/recorder/media/util/x;->a(JLandroid/util/Pair;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 23
    iget-object v0, p0, Les/aa;->c:Ljava/util/List;

    iget-object v1, p0, Les/aa;->l:Les/ba;

    invoke-interface {v0, v1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    const/4 v0, 0x0

    .line 24
    iput-object v0, p0, Les/aa;->l:Les/ba;

    .line 25
    :cond_0
    iget-object v0, p0, Les/aa;->c:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v0

    const/4 v1, -0x1

    if-eqz v0, :cond_1

    return v1

    .line 26
    :cond_1
    iget-object v0, p0, Les/aa;->l:Les/ba;

    const/4 v2, 0x0

    if-nez v0, :cond_4

    .line 27
    iget-object v0, p0, Les/aa;->c:Ljava/util/List;

    invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Les/ba;

    .line 28
    iget-wide v3, p1, Lcom/esfile/screen/recorder/media/util/l;->c:J

    iget-object v5, v0, Les/ba;->d:Landroid/util/Pair;

    invoke-static {v3, v4, v5}, Lcom/esfile/screen/recorder/media/util/x;->b(JLandroid/util/Pair;)Z

    move-result v3

    if-eqz v3, :cond_3

    .line 29
    invoke-direct {p0, v0}, Les/aa;->a(Les/ba;)Z

    move-result v3

    if-eqz v3, :cond_2

    .line 30
    iput-object v0, p0, Les/aa;->l:Les/ba;

    goto :goto_0

    .line 31
    :cond_2
    iget-object p1, p0, Les/aa;->c:Ljava/util/List;

    invoke-interface {p1, v0}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    :cond_3
    return v1

    .line 32
    :cond_4
    :goto_0
    iget-boolean v0, p0, Les/aa;->k:Z

    if-eqz v0, :cond_5

    return v1

    .line 33
    :cond_5
    monitor-enter p0

    .line 34
    :try_start_0
    iget-object v0, p0, Les/aa;->i:Ljava/nio/ByteBuffer;

    if-eqz v0, :cond_6

    iget-object v0, p0, Les/aa;->i:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->capacity()I

    move-result v0

    iget-object v1, p1, Lcom/esfile/screen/recorder/media/util/l;->b:Ljava/nio/ByteBuffer;

    invoke-virtual {v1}, Ljava/nio/ByteBuffer;->remaining()I

    move-result v1

    if-ge v0, v1, :cond_7

    .line 35
    :cond_6
    iget-object v0, p1, Lcom/esfile/screen/recorder/media/util/l;->b:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->capacity()I

    move-result v0

    invoke-static {v0}, Ljava/nio/ByteBuffer;->allocate(I)Ljava/nio/ByteBuffer;

    move-result-object v0

    iput-object v0, p0, Les/aa;->i:Ljava/nio/ByteBuffer;

    .line 36
    :cond_7
    iget-object v0, p0, Les/aa;->i:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;

    .line 37
    iget-object v0, p0, Les/aa;->i:Ljava/nio/ByteBuffer;

    invoke-virtual {v0, v2}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;

    .line 38
    iget-object v0, p0, Les/aa;->i:Ljava/nio/ByteBuffer;

    iget-object v1, p1, Lcom/esfile/screen/recorder/media/util/l;->b:Ljava/nio/ByteBuffer;

    invoke-virtual {v1}, Ljava/nio/ByteBuffer;->remaining()I

    move-result v1

    invoke-virtual {v0, v1}, Ljava/nio/ByteBuffer;->limit(I)Ljava/nio/Buffer;

    .line 39
    iget-object v0, p0, Les/aa;->i:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->array()[B

    move-result-object v0

    invoke-static {v0, v2}, Ljava/util/Arrays;->fill([BB)V

    .line 40
    :cond_8
    iget-boolean v0, p0, Les/aa;->d:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-eqz v0, :cond_f

    .line 41
    :goto_1
    :try_start_1
    iget-boolean v0, p0, Les/aa;->d:Z

    if-eqz v0, :cond_9

    iget-object v0, p0, Les/aa;->f:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_9

    iget-boolean v0, p0, Les/aa;->g:Z

    if-nez v0, :cond_9

    const-wide/16 v0, 0xa

    .line 42
    invoke-virtual {p0, v0, v1}, Ljava/lang/Object;->wait(J)V
    :try_end_1
    .catch Ljava/lang/InterruptedException; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_1

    .line 43
    :catch_0
    :cond_9
    :try_start_2
    iget-boolean v0, p0, Les/aa;->d:Z

    if-eqz v0, :cond_e

    iget-boolean v0, p0, Les/aa;->g:Z

    if-nez v0, :cond_a

    iget-object v0, p0, Les/aa;->f:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_a

    goto :goto_3

    .line 44
    :cond_a
    iget-object v0, p0, Les/aa;->f:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_b

    .line 45
    iget-object v0, p0, Les/aa;->f:Ljava/util/List;

    invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/esfile/screen/recorder/media/util/l;

    .line 46
    iget-object v1, v0, Lcom/esfile/screen/recorder/media/util/l;->b:Ljava/nio/ByteBuffer;

    iget-object v3, p0, Les/aa;->i:Ljava/nio/ByteBuffer;

    invoke-static {v1, v3}, Les/x9;->a(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)Z

    move-result v1

    .line 47
    iget-object v3, v0, Lcom/esfile/screen/recorder/media/util/l;->b:Ljava/nio/ByteBuffer;

    invoke-virtual {v3}, Ljava/nio/ByteBuffer;->remaining()I

    move-result v3

    if-gtz v3, :cond_c

    .line 48
    invoke-virtual {v0}, Lcom/esfile/screen/recorder/media/util/l;->a()V

    .line 49
    iget-object v3, p0, Les/aa;->f:Ljava/util/List;

    invoke-interface {v3, v0}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    .line 50
    invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V

    goto :goto_2

    :cond_b
    const/4 v1, 0x0

    :cond_c
    :goto_2
    const/4 v0, 0x1

    if-nez v1, :cond_d

    .line 51
    iget-boolean v3, p0, Les/aa;->g:Z

    if-eqz v3, :cond_d

    .line 52
    iput-boolean v0, p0, Les/aa;->k:Z

    .line 53
    iget-object v1, p0, Les/aa;->i:Ljava/nio/ByteBuffer;

    invoke-virtual {v1}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;

    .line 54
    iget-object v1, p0, Les/aa;->i:Ljava/nio/ByteBuffer;

    iget-object v3, p1, Lcom/esfile/screen/recorder/media/util/l;->b:Ljava/nio/ByteBuffer;

    invoke-virtual {v3}, Ljava/nio/ByteBuffer;->remaining()I

    move-result v3

    invoke-virtual {v1, v3}, Ljava/nio/ByteBuffer;->limit(I)Ljava/nio/Buffer;

    const/4 v1, 0x1

    :cond_d
    if-eqz v1, :cond_8

    .line 55
    iget-object v1, p0, Les/aa;->j:[Ljava/nio/ByteBuffer;

    iget-object v3, p0, Les/aa;->i:Ljava/nio/ByteBuffer;

    aput-object v3, v1, v2

    .line 56
    iget-object v1, p0, Les/aa;->j:[Ljava/nio/ByteBuffer;

    iget-object p1, p1, Lcom/esfile/screen/recorder/media/util/l;->b:Ljava/nio/ByteBuffer;

    aput-object p1, v1, v0

    .line 57
    iget-object p1, p0, Les/aa;->j:[Ljava/nio/ByteBuffer;

    iget-object p2, p2, Lcom/esfile/screen/recorder/media/util/l;->b:Ljava/nio/ByteBuffer;

    invoke-static {p1, p2}, Les/x9;->a([Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I

    move-result p1

    monitor-exit p0

    return p1

    .line 58
    :cond_e
    :goto_3
    monitor-exit p0

    return v2

    .line 59
    :cond_f
    monitor-exit p0

    return v2

    :catchall_0
    move-exception p1

    monitor-exit p0
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    goto :goto_5

    :goto_4
    throw p1

    :goto_5
    goto :goto_4
.end method

.method public b()I
    .locals 1

    .line 2
    iget-object v0, p0, Les/aa;->a:Les/w9$d;

    iget v0, v0, Les/w9$d;->c:I

    return v0
.end method

.method public c()Z
    .locals 2

    .line 2
    iget-boolean v0, p0, Les/aa;->e:Z

    if-nez v0, :cond_0

    const/4 v0, 0x1

    .line 3
    iput-boolean v0, p0, Les/aa;->d:Z

    return v0

    .line 4
    :cond_0
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string v1, "BackgroundAudioMixer has been released!"

    invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public declared-synchronized d()V
    .locals 1

    monitor-enter p0

    const/4 v0, 0x1

    .line 1
    :try_start_0
    iput-boolean v0, p0, Les/aa;->e:Z

    const/4 v0, 0x0

    .line 2
    iput-boolean v0, p0, Les/aa;->d:Z

    .line 3
    invoke-direct {p0}, Les/aa;->e()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 4
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method
